package com.duobaoyu.dby.supply.admin.controller.log;

import com.duobaoyu.dby.channel.adapter.enums.OperationTypeEnum;
import com.duobaoyu.dby.common.core.util.R;
import com.duobaoyu.dby.supply.admin.annotation.SupplySysLog;
import com.duobaoyu.dby.supply.admin.service.AdminOrderOperateLogBizService;
import com.duobaoyu.dby.supply.common.biz.dto.log.OperateLogDTO;
import com.duobaoyu.dby.supply.common.biz.vo.log.OperateLogDetailVO;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

/**
 * 订单操作日志
 * @Author yangyong
 * @Date 2023/10/23
 */
@RestController
@RequestMapping("/admin/log")
@RequiredArgsConstructor
public class OperateLogController {
	private final AdminOrderOperateLogBizService adminOrderOperateLogBizService;

	/**
	 * 订单操作日志详情
	 * @param operateLog 入参
	 */
	@PostMapping("/detail")
	@ApiOperation(value = "订单操作日志详情", notes = "订单操作日志详情")
	@SupplySysLog(value = "订单操作日志详情", operationType = OperationTypeEnum.SELECT)
	public R<List<OperateLogDetailVO>> listOperateLogDetail(@RequestBody @Valid OperateLogDTO operateLog){
		return R.ok(adminOrderOperateLogBizService.listOperateLogDetail(operateLog));
	}
}
